package cn.mldn.microboot.config;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * description:
 * Created by gy on 2017/8/20.
 */
@Aspect
@Component
public class ServiceAspect {

    private Logger log = LoggerFactory.getLogger(getClass());

    @Around("execution(* cn.mldn..service..*.*(..))")
    public Object surroundInvoke(ProceedingJoinPoint point) throws Throwable{
        this.log.info("Service-Before 执行参数" + Arrays.toString(point.getArgs()));
        Object obj = point.proceed(point.getArgs());//进行具体的业务调用
        this.log.info("Service-After 执行参数" + obj);
        return obj;
    }

}
